System and method for a single-pass multiple tap filter

ABSTRACT

A system and method for calculating an output value from a plurality of input sample values contributing to the output value in accordance with a respective weight value. A first intermediate value is interpolated for a first offset value from a first plurality of the input sample values and a second intermediate value is interpolated for a second offset value from a second plurality of the input sample values. The offset values are representative of the weight values of the input samples of the respective plurality of the input samples. The first and second intermediate values are combined to produce a resultant value which is subsequently blended with the remaining input sample values of the plurality in accordance with respective scaling values assigned to the resultant value and the remaining input sample values.

TECHNICAL FIELD

The present invention is related generally to the field of computergraphics, and more particularly, a system and method for resamplinggraphics data of a source image to produce a destination image.

BACKGROUND OF THE INVENTION

As visual output devices, such as computer monitors, printers, and thelike, of various sizes and resolutions have been developed, and thedemand for them have increased, the ability for a graphics processingsystem to resize and resample source images and create destinationimages to take advantage of the various sized and available resolutionsof devices is a desirable operation. In an electronic display system,color at each pixel is typically represented by a set of colorcomponents, and each color component is represented by a sample value.Color components such as red, green, blue (RGB) or other representationssuch as YC_(b)C_(r) are well known in the art. Whichever representationis chosen, each color component can be interpreted as a two dimensionalarray of samples, so three such arrays can represent images on displaysystems. Conceptually, resampling can be viewed as a spatial process,working on discrete input samples, represented by pixels of the sourceimage arranged in a two-dimensional bitmap. The output samples of thedestination image are spatially located at fractional sample positionswithin the input sample grid.

The resulting destination image, however, should retain an acceptableimage quality with respect to the source image. That is, the destinationimage should appear to retain similar visual qualities of the sourceimage, such as having nearly the same color balance, contrast, andbrightness as the original source image. Otherwise, rather thanaccurately reproducing a resized graphics image of the source image, therescaling operation will compromise image quality by introducing imagedistortion. To this end, various interpolation and filtering circuitsand methods have been developed in order to create high qualitydestination graphics images.

In many conventional filtering algorithms where the resolution of asource image is reduced, a plurality of source samples are combined toyield a destination sample value. The method by which the source samplevalues are combined can be rather complicated. For example, thecontribution of each of the source samples is typically weighted suchthat source samples that are more distant from the location of thedestination relative to the position of the source samples contributeless to the resulting destination sample value. Moreover, the algorithmapplied to combine the source sample values may include linear andnon-linear models. Additionally, the number of source samples that areused in calculating the resulting destination value affects the qualityof the resulting resized image.

Implementation of these conventional filtering algorithms generallyrequire additional circuitry to be included in the graphics processingsystem to facilitate the filtering operation. The space consumed by suchadditional circuitry may also depend on the number of source samplesused in calculating the destination value, that is, the number of “taps”required to sample the source sample values. The more taps filtercircuitry requires, the more complicated the circuitry becomes and themore space that is necessary to accommodate the circuitry. Althoughdedicated filtering circuitry improves processing throughput, wherespace is limited or miniature device size is desired, the inclusion ofthe additional dedicated filtering circuitry may not be an acceptablealternative. An alternative approach to implementing conventionalmulti-sample filtering algorithms is to include minimal additionaldedicated filtering circuitry, but repeat certain processes through thesame circuitry to yield a final output destination value. In effect,performance of the filtering operation requires multiple passes throughthe filtering circuitry. Although the space consumed by the circuitry isminimized, graphics processing throughput may suffer because of thebottleneck the multiple pass filtering process creates.

Therefore, there is a need for an alternative system and method forimplementing a multi-tap filter in a graphics processing system.

SUMMARY OF THE INVENTION

The present invention relates to a system and method for calculating anoutput value from a plurality of input sample values. Each of the inputsample values contributing to the output value according to a respectiveweight value. A first intermediate value is interpolated for a firstoffset value from a first plurality of the input sample values and asecond intermediate value is interpolated for a second offset value froma second plurality of the input sample values. The offset values arerepresentative of the weight values of the input samples of therespective plurality of the input samples. The first and secondintermediate values are combined to produce a resultant value which issubsequently blended with the remaining input sample values of theplurality in accordance with respective scaling values assigned to theresultant value and the remaining input sample values. The

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a computer system in which embodiments ofthe present invention are implemented.

FIG. 2 is a block diagram of a graphics processing system in thecomputer system of FIG. 1.

FIG. 3 is a block diagram of a portion of a pixel pipeline of thegraphics processing system of FIG. 2 according to an embodiment of thepresent invention.

FIG. 4 is a block diagram of a bilinear filter stage of the pixelpipeline of FIG. 3.

FIG. 5 is a block diagram of a combining stage of the pixel pipeline ofFIG. 3.

FIG. 6 is a block diagram of a blending stage of the pixel pipeline ofFIG. 3.

FIG. 7 is a flow diagram illustrating an embodiment of the presentinvention.

FIG. 8 is a conceptual representation of a filtering application of thepresent invention.

DETAILED DESCRIPTION OF THE INVENTION

Embodiments of the present invention provide a single-pass five-tapfilter for generating an output sample value based on five input samplevalues applied with different weighting factors. Embodiments of thepresent invention can be implemented using existing processing stages ofa graphics processing system, thus, reducing the need for additionalprocessing circuitry to carry out the five-tap filtering process.Certain details are set forth below to provide a sufficientunderstanding of the invention. However, it will be clear to one skilledin the art that the invention may be practiced without these particulardetails. In other instances, well-known circuits, control signals,timing protocols, and software operations have not been shown in detailin order to avoid unnecessarily obscuring the invention.

FIG. 1 illustrates a computer system 100 in which embodiments of thepresent invention are implemented. The computer system 100 includes aprocessor 104 coupled to a host memory 108 through a memory/businterface 112. The memory/bus interface 112 is coupled to an expansionbus 116, such as an industry standard architecture (ISA) bus or aperipheral component interconnect (PCI) bus. The computer system 100also includes one or more input devices 120, such as a keypad or amouse, coupled to the processor 104 through the expansion bus 116 andthe memory/bus interface 112. The input devices 120 allow an operator oran electronic device to input data to the computer system 100. One ormore output devices 120 are coupled to the processor 104 to provideoutput data generated by the processor 104. The output devices 124 arecoupled to the processor 104 through the expansion bus 116 andmemory/bus interface 112. Examples of output devices 124 includeprinters and a sound card driving audio speakers. One or more datastorage devices 128 are coupled to the processor 104 through thememory/bus interface 112 and the expansion bus 116 to store data in, orretrieve data from, storage media (not shown). Examples of storagedevices 128 and storage media include fixed disk drives, floppy diskdrives, tape cassettes and compact-disc read-only memory drives.

The computer system 100 further includes a graphics processing system132 coupled to the processor 104 through the expansion bus 116 andmemory/bus interface 112. Optionally, the graphics processing system 132may be coupled to the processor 104 and the host memory 108 throughother types of architectures. For example, the graphics processingsystem 132 may be coupled through the memory/bus interface 112 and ahigh speed bus 136, such as an accelerated graphics port (AGP), toprovide the graphics processing system 132 with direct memory access(DMA) to the host memory 108. That is, the high speed bus 136 and memorybus interface 112 allow the graphics processing system 132 to read andwrite host memory 108 without the intervention of the processor 104.Thus, data may be transferred to, and from, the host memory 108 attransfer rates much greater than over the expansion bus 116. A display140 is coupled to the graphics processing system 132 to display graphicsimages. The display 140 may be any type of display, such as a cathoderay tube (CRT), a field emission display (FED), a liquid crystal display(LCD), or the like, which are commonly used for desktop computers,portable computers, and workstation or server applications.

FIG. 2 illustrates circuitry included within the graphics processingsystem 132 for performing various three-dimensional (3D) graphicsfunctions. It will be appreciated that the graphics processing system132 illustrated in FIG. 2 may include additional circuitry notspecifically shown therein, and that the description is provided merelyfor the purposes of illustration. The following description of theparticular functionality and operation of the graphics processing system132 is not intended to limit the scope of the present invention to thespecific embodiments discussed below. As shown in FIG. 2, a businterface 200 couples the graphics processing system 132 to theexpansion bus 116. In the case where the graphics processing system 132is coupled to the processor 104 and the host memory 108 through the highspeed data bus 136 and the memory/bus interface 112, the bus interface200 will include a DMA controller (not shown) to coordinate transfer ofdata to and from the host memory 108 and the processor 104. A graphicsprocessor 204 is coupled to the bus interface 200 and is designed toperform various graphics and video processing functions, such as, butnot limited to, generating vertex data and performing vertextransformations for polygon graphics primitives that are used to model3D objects. The graphics processor 204 is coupled to a triangle engine208, which includes circuitry for performing various graphics functions,such as attribute transformations, calculating texel coordinates of atexture map, and rendering of graphics primitives.

A pixel engine 212 is coupled to receive the graphics data generated bythe triangle engine 208. The pixel engine 212 contains circuitry forperforming various graphics functions, such as, but not limited to,clipping, texture application or mapping, bilinear filtering, fog,blending, and color space conversion. The graphics functions areperformed by a pixel processing pipeline 214 that is included in thepixel engine 212.

A memory controller 216 coupled to the pixel engine 212 and the graphicsprocessor 204 handles memory requests to and from an local memory 220.The local memory 220 stores graphics data, such as source pixel colorvalues and destination pixel color values. A display controller 224 iscoupled to the memory controller 216 to receive processed destinationcolor values for pixels that are to be rendered. The destination colorvalues are subsequently provided to a display driver 232 that includescircuitry to provide digital color signals, or convert digital colorsignals to red, green, and blue analog color signals, to drive thedisplay 140 (FIG. 1).

FIG. 3 illustrates a portion of a pixel pipeline 300 that may beincluded in the pixel engine 212 (FIG. 2). The pixel pipeline 300includes a texture filtering unit 304, a texture combine unit 308, and ablending unit 312. Pixel processing through the pixel pipeline 300 ismade in a “single-pass.” That is, pixel attributes such as color andopacity, or alpha, values are calculated in a pipeline fashion, whereprocessing begins with the texture filtering unit 304 and proceedsthrough the texture combine unit 308 and the blending unit 312 toproduce output values of a pixel in a single-pass through the pipeline300. As will be explained in more detail below, in operation, thetexture filtering unit 304, texture combine unit 308, and the blendingunit 312 are used to implement a single-pass five-tap filter, unlikeconventional five-tap filters that perform the filtering operation inmultiple passes. The texture filtering unit 304, texture combine unit308 and the blending unit 312 will be described with respect to FIGS.3-6, and will be followed by a description of a single-pass five-tapfiltering operation implemented therein.

The texture filter unit 304 performs filter functions on texture data.The texture filter unit 304 includes circuitry for performing filterfunctions for a plurality of textures. As briefly mentioned above, thetriangle engine 208 provides the pixel engine 212 information such aspixel addresses and corresponding texel addresses. The texture filterunit 304 uses the information to generate attributes of a pixel, such asits color, opacity, and the like, through a filter process. Onefiltering method that may be used by the texture filtering unit 304 incalculating the attributes of a pixel is bilinear interpolation. As iswell known in the art, bilinear interpolation applies a linear functionin calculating a weighting value for each color of four adjacent texelsC_(t0)-C_(t3) based on the “location” of the pixel relative to the fourtexels. The resulting pixel color C_(t) is the sum of the color valuesof the four source pixels, weighted by the appropriate weighting value.Bilinear interpolation, as well as conventional filtering methods thatmay be implemented in the texture filtering unit 304, are well known inthe art. Coupled to the texture filtering unit 304 to receive thecalculated attributes for the pixels, such as color value C_(t) andopacity or alpha value A_(t) is the texture combine unit 308. Thetexture combine unit 308 is capable of combining the color valuesreceived from the texture filtering unit with constant color and alphavalues C_(c) and A_(c), or the attributes of other pixels havingdifferent textures applied to them. The resulting fragment attributesC_(f) and A_(f) are provided by the texture combine unit 308 to theblending unit 312. The blending unit 312 performs blending operations,such as determining output color and alpha values C_(p) and A_(p) forpixels based on the opacity and color of two or more pixels that will beoverlaid in the final image.

It will be appreciated that the texture filtering unit 304, the texturecombine unit 308, and the blending unit 312 may further perform otherconventional graphics processing and operations in addition to thosepreviously described. For example, the stages previously discussed mayalso perform operations to combine opacity values for pixels, mipmappingand dithering operations, as well as performing fog effect orlevel-or-detail calculations. Moreover, as previously mentioned, FIG. 3illustrates a portion of a pixel pipeline. It will be furtherappreciated that additional stages or circuitry may be included as well,such as cache memory for temporary storage of texture and pixel data, alighting unit to perform lighting calculations, and the like. In theinterest of brevity, a more detailed description has been omitted fromherein.

Shown in FIG. 4 is a bilinear filter stage 400 that may be included inthe texture filter unit 304 (FIG. 3). The bilinear filter stage 400includes a first bilinear filter stage 404 and a second bilinear filterstage 408. Each bilinear filter stage can apply a different texture,namely a first texture C_(T0) and a second texture C_(T2). Each filterstage performs a conventional bilinear interpolation operation from thefour respective texel color values C_(t0)-C_(t3) to calculate arespective pixel color value C_(t). That is,C _(t)=Weight₀ ·C _(t0)+Weight₁ ·C _(t1)+Weight₂ ·C _(t2)+Weight₃ ·C_(t3)whereWeight₀=(1−rU)·(1−rV), Weight₁=(rU)·(1−rV),Weight₂=(1−rU)·(rV), and Weight₃=(rU)·(rV),where rU and rV are the fractional coordinates of the pixel for whichthe pixel color value C_(t) is being calculated.

Shown in FIG. 5 are a texture pre-combine stage 504 and a texturepost-combine stage 508 that are included in the texture combine unit 308(FIG. 3). Both the texture pre-combine stage 504 and the post-combinestage 508 perform pixel attribute combination operations. As illustratedin FIG. 5, the texture pre-combine stage 504 receives up to fourdifferent input color and alpha values C₀-C₃ and A₀-A₃. The input valuescan be selected from several different values, for example, constantcolor and alpha values C_(c) and A_(c), a constant value such as zero,or the output of the bilinear filter stages 404 and 408 (FIG. 4) C_(t0),A_(t0) and C_(t1), A_(t1). Selection of the input values can be madeprogrammatically. Although not shown in FIG. 4, it will be appreciatedthat the values from which the input values C₀-C₃ can be selected mayinclude other values as well.

As mentioned previously, the texture pre-combine stage 504 can performvarious pixel attribute combination operations to generate output valuesC_(op) and A_(op). Typical combine operations that the texturepre-combine stage 504 can perform include various Boolean logicoperations, such asC_(op)=C0 AND C3, C_(op)=C0 OR C3, and C_(op)=C0 XOR C3,as well as more sophisticated combine operations, such asC _(op) =C0*(C1−C2)+C3.Selection of the particular operation that is performed by the texturepre-combine stage 504 is made programmatically.

The texture post-combine stage 508 receives the output values C_(op) andA_(op) from the texture pre-combine stage 504 and can perform a varietyof additional operations to calculate output values C_(out) and A_(out)therefrom. Examples of the types of operations that can be performed bythe texture post-combine stage 508 include:

-   -   no operation C_(out)=C_(op)    -   modulate 2× Cout=Cop<<1    -   demodulate 2× Cout=Cop>>1    -   sum Cout=Cr+Cg+Cb, RGB color components        As with the texture pre-combine stage 504, the selection of the        operation can be made programmatically.

FIG. 6 illustrates blending stages 604-606 that are included in theblending unit 312. The source blending stage 604 blends source color andalpha values C_(s) and A_(s) with destination color and alpha valuesC_(d) and A_(d), or constant color and alpha values C_(c) and A_(c) toproduce blended output values C_(src) and A_(src). Similarly, thedestination blending stage 605 blends the destination color and alphavalues C_(d) and A_(d) with the source color and alpha values C_(s) andA_(s) or the constant color and alpha values C_(c) and A_(c) to produceblended output values C_(dst) and A_(dst). For example, with respect tothe source blending stage 604, some of the source blend operations thatcan be performed include: Operation RGB Alpha BlendDstColor C_(s)*C_(d)A_(s)*A_(d) BlendDstAlpha C_(s)*A_(d) A_(s)*A_(d) BlendSrcColorC_(s)*C_(s) A_(s)*A_(s) BlendSrcAlpha C_(s)*A_(s) A_(s)*A_(s)BlendConstColor C_(s)*C_(c) A_(s)*A_(c) BlendConstAlpha C_(s)*A_(c)A_(s)*A_(c) Blend0 0 0 Blend1 C_(s) A_(s)

Similarly, the destination blending stage 605, the destination blendoperations can include: Operation RGB Alpha BlendSrcColor C_(d)*C_(s)A_(d)*A_(s) BlendSrdAlpha C_(d)*A_(s) A_(d)*A_(s) BlendDestColorC_(d)*C_(d) A_(d)*A_(d) BlendDestAlpha C_(d)*A_(d) A_(d)*A_(d)BlendConstColor C_(d)*C_(c) A_(d)*A_(c) BlendConstAlpha C_(d)*A_(c)A_(d)*A_(c) Blend0 0 0 Blend1 C_(d) A_(d)

The final blend stage 606 receives the output C_(src), A_(src), C_(dst)and A_(dst) of the source and destination blending stages 604 and 605,respectively, and performs a final blending operation to produce outputcolor and alpha values C_(p) and A_(p). Examples of the types of finalblending operations included are:C _(p) =C _(src) +C _(dst),C _(p) =C _(src) −C _(dst), andC _(p) =C _(dst) −C _(src).The blending operations of the source and destination blending stages604 and 605, respectively, and the final blending stage 606 are selectedprogrammatically.

It will be appreciated that the various processing stages shown in anddescribed with respect to FIGS. 4-6 are conventional in design andfunctionality. Those of ordinary skill in the art have sufficientunderstanding to practice the present invention based on the descriptionprovided herein. For example, the programmability of the variousprocessing stages and the selection of the particular values forprocessing is well known in the art. Consequently, in order to avoidunnecessarily obscuring the invention, further description has beenomitted from herein. It will be further appreciated that the colorvalues may consist of several different components. For example, thecolor value may represent pixel colors which are the combination of red,green, and blue color components. Another example includes color valuesrepresenting pixel colors which are the combination of luma and chromacomponents. Consequently, because it is well understood in the art,although circuitry to perform graphics operation for each of thecomponents is not expressly shown or described herein, embodiments ofthe present invention include circuitry, control signals, and the likenecessary to perform processing on each component for multi-componentcolor values.

Operation of the single-pass five-tap filter will be described withrespect to FIGS. 7 and 8. As mentioned previously, the five-tapfiltering operation is performed in a single pass through the pixelpipeline 300 (FIG. 3). The flow diagram of FIG. 7 describes thesingle-pass process and FIG. 8 illustrates a particular application ofthe single-pass process. In FIG. 8 a, five scanlines A−2, A−1, A, A+1,and A+2 of pixels arranged in the manner shown, will be reduced to asingle scanline A′ in a single-pass. The color values of the pixels ofthe scanlines A−2, A−1, A, A+1, and A+2 will contribute to the colorvalue of the pixels of the final scanline A′ according to the weights10%, 20%, 40%, 20%, and 10%, respectively. It will be appreciated thatthe scanlines are composed of individual pixels arranged in successionalong the respective scanline. The five color samples C_(A−2), C_(A−1),C_(A), C_(A+1), and C_(A+2) for the filtering process are taken from thelocation of a pixel from in each of the five scanlines where the pixelsare aligned in a common column, such as pixels P_(A−2), P_(A−1), P_(A),P_(A+1), and P_(A+2). The result of the filter process is to provide adestination pixel P_(A)′ having a color value C_(A)′ that is thecombination of the color values C_(A−2), C_(A−1), C_(A), C_(A+1), andC_(A+2) of the five pixels sampled from each scanline. As the filteringprocess proceeds to subsequent pixels along each scanline, a destinationscanline A′ will be generated.

The five-tap filtering process begins with performing bilinearinterpolation of a pixels P_(A−2) and P_(A−1) from scanlines A−2 andA−1, respectively (step 702, FIG. 7). Note that the destination pixelP_(A)′ is aligned in the same column as the pixels P_(A−2) and P_(A−1).That is, the fractional horizontal position rU with respect to thepixels P_(A−2) and P_(A−1) is zero, and consequently, the “bilinear”operation is reduced to a linear interpolation between the pixelsP_(A−2) and P_(A−1). Additionally, as shown in FIG. 8 a, thecontribution of scanlines A−2 and A−1 to the final scanline A′ are 10%and 20% respectively. By determining and providing appropriatecoordinate values, a conventional bilinear filter stage can be used toperform the interpolation process of step 702. For example, a verticaloffset value V₀, which is measured relative to the scanline A−2, iscalculated and provided to the bilinear filter stage 404 (FIG. 4) suchthat the contribution of the pixel P_(A−1) carries twice the weight ofthe contribution of the pixel P_(A−2) to the color value C_(A−1)′ of anoutput pixel P_(A−1)′. As mentioned previously, for the interpolationoperation of step 702, the fractional horizontal position is zero. Thus,the coordinates that are provided to the bilinear filter stage 404 are(0, 2/3), that is, the output pixel P_(A−1)′ is in the same column asP_(A−1) and P_(A−2), and the vertical offset V₀ from the scanline A−2 isequal to two-thirds. As a result, the bilinear interpolation equationreduces to (1/3 C_(A−1)+2/3 C_(A−2)), and the output C_(t0) of thebilinear filter stage 404 is the color value C_(A−1)′ for the pixelP_(A−1)′.

The pixels P_(A+1) and P_(A+2), from scanlines A+1 and A+2,respectively, are also interpolated (step 704) in a manner similar tothat previously described with respect to pixels P_(A−2) and P_(A−1).However, the vertical offset V₁ for the interpolation of pixels P_(A+1)and P_(A+2) is adjusted such that when measured from the scanline A−2,the contribution of P_(A+1) is twice that of the contribution by P_(A+2)to the color value C_(A+1)′ of an output pixel P_(A+1)′. The horizontaloffset is still zero. Thus, the coordinates that are provided to thebilinear filter stage 408 are (0, 3 1/3). As a result, the bilinearinterpolation equation reduces to (2/3 P_(A+1)+1/3 P_(A+2)) and theoutput C_(t1) of the bilinear filter stage 408 is the color valueC_(A+1)′ for P_(A+1)′. Although interpolation steps 702 and 704 areshown in FIG. 7, and described with respect bilinear filter stages 404and 408, as being performed in parallel, it will be appreciated that theinterpolation process may be performed sequentially instead.

Following the interpolation of pixels P_(A−2) and P_(A−1), and P_(A+1)and P_(A+2), the two interpolated color values C_(A−1)′ and C_(A+1)′ foroutput pixels P_(A−1)′ and P_(A+1)′, respectively, are averaged (step708). By programming the texture pre-combine stage 504 and a texturepost-combine stage 508, shown in FIG. 5, to perform the appropriatecalculations on selected input values, the stages 504 and 508 can beused to perform the averaging operation of step 708. That is, asmentioned previously, the texture pre-combine stage 504 can beprogrammed to calculate an output value C_(op) from the equation:C _(op) =C0*(C1−C2)+C3,and the texture post-combine stage 508 can be programmed to perform ademodulate-by-two operation such that:C _(out) =C _(op)<<1.By selecting the input values C0-C3 to the texture pre-combine stage 504to be:C0=C_(t0), C1=C_(c)=1, C₂=0, and C₃=C_(t1),the color values for the output pixels P_(A−1)′ and P_(A+1)′ areaveraged, that is:C _(out) =[C _(t0)*(1−0)+C _(t1)]>>1, orC _(out) =[C _(t0) +C _(t1)]>>1,where C_(out) is the averaged color value of C_(t0) and C_(t1).

The averaged color value C_(out) is then blended with the color valueC_(A) of a pixel P_(A) (step 714), a pixel from the scanline A in thesame column as pixels P_(A−2), P_(A−1), P_(A+1), and P_(A+2). The colorvalues are alpha blended using alpha values programmed corresponding tothe weights defined in FIG. 8 (steps 710, 712). The alpha value A_(A)assigned to the pixel P_(A) is selected such that it corresponds to the40% weight the color value C_(A) contributes to the output color valueC_(A)′ of the output pixel P_(A)′. Accordingly, the alpha value A_(out)for the averaged color value C_(out) is assigned a value 60%, such thatthe total contribution of the C_(A)′ and C_(out) are equal to 100%.

The blending operation is performed in the blending stages 604-606 (FIG.6). As previously discussed, the source blending stage 604 and thedestination blending stage 605 can be programmed to perform a selectblending operation with various input color and alpha values. The sourceblending stage 604 is programmed to perform the blending operation:C _(src) =C _(s) *A _(c),and the destination blending stage 605 is programmed to perform theblending operation:C _(dst) =C _(d) *C _(c).The final blending stage 606 is programmed to perform a final blendoperation:C _(p) =C _(ssrc) +C _(dst).

A value is programmed for constant color and alpha values C_(c) andA_(c) such that the source and destination blending operations willweight the contribution of the color values C_(out) and C_(A)accordingly, when the final blend stage 606 blends C_(src) and C_(dst)to produce the color value C_(A)′ of the output pixel P_(A)′. That is,the effective alpha value A_(out) is equal to A_(c) and the effectivealpha value A_(A) is equal to C_(c). Where actual percentage valuescannot be programmed, it may be necessary to program equivalent valuesfor A_(c) (=A_(out)) and C_(c) (=A_(A)), that are representative of therespective alpha percentages. For example, where a 32-bit number is usedfor C_(c) and A_(c), such that the eight most significant bits representA_(c) and the 24 least significant bits represent C_(c), the appropriatevalue for a 40%/60% weighting is 99666666H. Thus, to have the blendingstages 604-606 perform the blending operation of step 714:C _(s) =C _(out) , C _(d) =C ₀ , A _(c) ·C _(c)=99666666H,resulting in:C _(p)=(C _(s) *A _(c))+(C _(d) *C _(c)), orC _(p)=(C _(s)*60%)+(C _(d)*40%).The color value C_(p) is the final color value C_(A)′ for the outputpixel P_(A)′. It can be shown, as follows, that the process previouslydescribed yields a color value having the correct weighting as definedin FIG. 8 a.$C_{A^{\prime}} = {{\frac{6}{10} \cdot \left\lbrack \frac{\left( {{\frac{1}{3}C_{A - 2}} + {\frac{2}{3}C_{A - 1}}} \right) + \left( {{\frac{2}{3}C_{A + 1}} + {\frac{1}{3}C_{A + 2}}} \right)}{2} \right\rbrack} + {\frac{4}{10}C_{A}}}$$C_{A^{\prime}} = {{\frac{6}{10} \cdot \left\lbrack {\left( {{\frac{1}{6}C_{A - 2}} + {\frac{2}{6}C_{A - 1}}} \right) + \left( {{\frac{2}{6}C_{A + 1}} + {\frac{1}{6}C_{A + 2}}} \right)} \right\rbrack} + {\frac{4}{10}C_{A}}}$$C_{A^{\prime}} = {{\frac{1}{10}C_{A - 2}} + {\frac{2}{10}C_{A - 1}} + {\frac{4}{10}C_{A}} + {\frac{2}{10}C_{A + 1}} + {\frac{1}{10}C_{A + 2}}}$

+It will be appreciated that the weights shown in FIG. 8 and thecorresponding values described with respect thereto are exemplary, andthat other weights can be used as well. To accommodate different weightsused in the single-pass five-tap filtering process may need to beadjusted. For example, the vertical offsets used in interpolatingbetween pixels P_(A−2) and P_(A−1) and pixels P_(A+1) and P_(A+2) mayneed to be adjusted, as well as the constant color and alpha valuesC_(c) and A_(c) used in the blending operation.

From the foregoing it will be appreciated that, although specificembodiments of the invention have been described herein for purposes ofillustration, various modifications may be made without deviating fromthe spirit and scope of the invention. Accordingly, the invention is notlimited except as by the appended claims.

1. A method for calculating an output value from a plurality of inputsample values, each having respective weight values of contribution tothe output value, the method comprising: for a first offset value,interpolating a first intermediate value from a first plurality of theinput sample values, the first offset value representative of therespective weight values of the input sample values of the firstplurality; for a second offset value, interpolating a secondintermediate value from a second plurality of the input sample values,the second offset value representative of the respective weight valuesof the input sample values of the second plurality; combining the firstand second intermediate values to produce a resultant value; andblending together the resultant value and remaining input sample valuesin accordance with respective scaling values assigned thereto. 2-19.(Cancelled)